UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FtowQhF81NIh23rov7FKtVBtEYVG0A8CwO9lQHFLIwY=' 
WHERE 
  key_id = '825290e09484be8def16475448fea55d696282572da8473112e6d4eff915a670' 
  AND (
    token = 'FtowQhF81NIh23rov7FKtVBtEYVG0A8CwO9lQHFLIwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016