UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C5oa4cueku4tfJbG2jQmEDjoHH+cB5XQgHRmGhpmwHE=' 
WHERE 
  key_id = '85ea59856ba1ab82fc3e5d6d6f78322e7032ac00e8fe37fc9ee86c5223fe286e' 
  AND (
    token = 'C5oa4cueku4tfJbG2jQmEDjoHH+cB5XQgHRmGhpmwHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039