UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ivlmqfnOJRZ/7cTBuKRcWPBkTVch8m2UlpTM0pfZgqs='
WHERE
key_id = 'e704cae5ea42343207286e0fdc48e4bd814f81536ad8395e4b157baf2a2f38e3'
AND (
token = 'ivlmqfnOJRZ/7cTBuKRcWPBkTVch8m2UlpTM0pfZgqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)