UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aVWQog/sieoPU88ykZUFNvLIYVup/iEP9UIjHmLM3ik=' 
WHERE 
  key_id = 'daf50dfd54715942d23defedc7fc33b44b89ee31af64a4a771646a5d369af682' 
  AND (
    token = 'aVWQog/sieoPU88ykZUFNvLIYVup/iEP9UIjHmLM3ik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020