UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd6U0BoyWAhl3+gNeRCEgZIh4gbqoR3hpQRG/wOHNxnk='
WHERE
key_id = '0918e6ed2fee60c92b136e7ecef0234be701087fcf7854bad56a3fa6aeec6c02'
AND (
token = 'd6U0BoyWAhl3+gNeRCEgZIh4gbqoR3hpQRG/wOHNxnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)