UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L46fODm5l2MS38HbMy9JLy6fOgJ9Ju8HHdKmY24xI78='
WHERE
key_id = '2d8fb4ec7599d303b2444e819bc90d4afc7f0ade8dcd05a810c36f15fb306098'
AND (
token = 'L46fODm5l2MS38HbMy9JLy6fOgJ9Ju8HHdKmY24xI78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)