UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ptKMCIsYbzh3AAJlSMKcusocB1nFlOoqWe21iJSuR8c='
WHERE
key_id = 'f8f2c6ffe0f9f705e5398c4aa75da60c08554f23ace4c24207543bf7fca5b125'
AND (
token = 'ptKMCIsYbzh3AAJlSMKcusocB1nFlOoqWe21iJSuR8c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)