UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AvZLgjDfqF+eELtUSWvggEvf/Os4voXpEEjAQbYFkLc='
WHERE
key_id = '91a55db48a15adf4c7867e50ee6b21a91b80bf6c8fc7e656f6a54acc3e1945d5'
AND (
token = 'AvZLgjDfqF+eELtUSWvggEvf/Os4voXpEEjAQbYFkLc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)