UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JeusDOih2ppwydIp9XtC/fXYb4ORHSN0W6kEfCJd6vU=' 
WHERE 
  key_id = '3b613a650e3d73c51187adc249d101d1d81c786bf1735891d9d0f295316a6e49' 
  AND (
    token = 'JeusDOih2ppwydIp9XtC/fXYb4ORHSN0W6kEfCJd6vU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053