UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lJWaqP4rv3jc5abq12pfUcl9CyNXIrH5Omm3A2o9sCc='
WHERE
key_id = '935c8e28168723474b47c857d5d08f87e07185ba9555f8e48acc608d09646b17'
AND (
token = 'lJWaqP4rv3jc5abq12pfUcl9CyNXIrH5Omm3A2o9sCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)