UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dED+YL15bsYfcOpPjnZpI/lWeVu2SvFvkwi1j6piqd8='
WHERE
key_id = 'e465e60ea9fb8fe3b81ca6c1dfcd5eaabe1c13f372d6e8ab649b5a8422a7ed8f'
AND (
token = 'dED+YL15bsYfcOpPjnZpI/lWeVu2SvFvkwi1j6piqd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)