UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ylHwo/UWLdGcAchbaJCuk9bcHgwxrOh/N5AjI/chTww=' 
WHERE 
  key_id = 'a75a3f40b19b25807ea11a8f7398a05cbf5e6d46358ba828d6677abe752614f3' 
  AND (
    token = 'ylHwo/UWLdGcAchbaJCuk9bcHgwxrOh/N5AjI/chTww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021