UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ObuyFa8jtz6233ngbfi7mfLNiUNBMskXZ6xzqKn3r7E=' 
WHERE 
  key_id = '8544c29191e6440f3ffed8dedf87f9e92ec71cde5968edae78ea0d0b630d2688' 
  AND (
    token = 'ObuyFa8jtz6233ngbfi7mfLNiUNBMskXZ6xzqKn3r7E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055