UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Ci19NTwCFpEuWIyKHU0zrd+L82FxctRi0ZVg4C80WE=' 
WHERE 
  key_id = '4914ae96306403fc5988b856705a6e04d91bb1540dc0b1c35885c1643fe96be9' 
  AND (
    token = '3Ci19NTwCFpEuWIyKHU0zrd+L82FxctRi0ZVg4C80WE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041