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