UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v9aT9/lFsSwzroXVDawXJIkpWGPpftPX7FFLiDm5KHo='
WHERE
key_id = 'df0c98c62378d6d0a168a1a41eec49a63e4cf6b1520f5d0ec0c04046aae17316'
AND (
token = 'v9aT9/lFsSwzroXVDawXJIkpWGPpftPX7FFLiDm5KHo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)