UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6LzMLrH/QFuP9KCp+0+dgDrdbO9HG9sFVa4La35eSsQ=' 
WHERE 
  key_id = '9fc295943ad9bee97edb677da5bbec9c2c6e14b4c945d3f04a8ec7573c22cb9b' 
  AND (
    token = '6LzMLrH/QFuP9KCp+0+dgDrdbO9HG9sFVa4La35eSsQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026