UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm68nT9pF02goIA18sBJRRTYB59MjISNkoHClBjBan78='
WHERE
key_id = '70dd20eae74ed1a19918e275e8edd96117f17bd9548ec9e09c484ff4736f088f'
AND (
token = 'm68nT9pF02goIA18sBJRRTYB59MjISNkoHClBjBan78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)