UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Q6EvtExc+zE0PMBUstkA3VdHPouk7PnhL26TIU47bE=' 
WHERE 
  key_id = '729699d8886a44acc0e25f8afdc0f843576cd514c52f1ba761bb8e7692f0725c' 
  AND (
    token = '7Q6EvtExc+zE0PMBUstkA3VdHPouk7PnhL26TIU47bE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017