UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kgoZB3/QE0Q9Fdloz4o+FsIvmnph35PSCFUBZ1kvYHo=' 
WHERE 
  key_id = '37e656eca7cbff0e278160b9b097684e96dfcd97c6559b1c58812ba03c38923b' 
  AND (
    token = 'kgoZB3/QE0Q9Fdloz4o+FsIvmnph35PSCFUBZ1kvYHo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074