UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VrfenrgRAZA9GcJX/tNfkSmlqna3XrnRnmgD4Smbhmk='
WHERE
key_id = '29434204252d4af5e5c9fa5c0b25003b34bb0feb32d20a2b235dce4b89529112'
AND (
token = 'VrfenrgRAZA9GcJX/tNfkSmlqna3XrnRnmgD4Smbhmk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)