UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WOgELQjqQE+/YGpkX8LPxs1nU3ewTvjr3SNaFwyPoaQ=' 
WHERE 
  key_id = 'e6008459e87bdaef8700e018c94db7b3de685309a5d1120d990e967092d65748' 
  AND (
    token = 'WOgELQjqQE+/YGpkX8LPxs1nU3ewTvjr3SNaFwyPoaQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017