UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fpfya/AeoitbvQfpA2+E9PvoxhKUCZho/QMjUZ6eRZw='
WHERE
key_id = 'f1128c3ed668ed8afca5cdf10aa3cce97ec79e1b7fbe2326f405ac9eb69cc8e0'
AND (
token = 'Fpfya/AeoitbvQfpA2+E9PvoxhKUCZho/QMjUZ6eRZw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)