UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0sdosRW5Gt1UGy8t+Gf23kkjxKo4K87NZzmWwunEO9A='
WHERE
key_id = '3996d8554c41f0d10f4c0a9448d0b201399fcdb79997f77bb1c5c430a5d6c3b6'
AND (
token = '0sdosRW5Gt1UGy8t+Gf23kkjxKo4K87NZzmWwunEO9A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)