UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1VNeLgn9Xh2RDhfMQuAtRlcJN9RXd3yv+ZAHycOj+70=' 
WHERE 
  key_id = '7092035d10e42ed1432f247583724eea0e35d0805f1fece5e87376bc239b6801' 
  AND (
    token = '1VNeLgn9Xh2RDhfMQuAtRlcJN9RXd3yv+ZAHycOj+70=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038