UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Vx7T3czeOtEUECpdgfZDMvfjl6OLla02XJhDMeWNdE=' 
WHERE 
  key_id = '98a5d4ee9edab42d45d8e432cbafc76d9b868f9dd27639a7a4343b485f3fbc35' 
  AND (
    token = '0Vx7T3czeOtEUECpdgfZDMvfjl6OLla02XJhDMeWNdE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018