UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bhPcBqyoGpEiRoJhBvgRGw2ZnryYtEniARQwfxXyvk0=' 
WHERE 
  key_id = 'ef3a03e5ebdaeb2bfae1ae61d511b8c8aa9ab5f9f02c3ff7e3129127c0b8eb96' 
  AND (
    token = 'bhPcBqyoGpEiRoJhBvgRGw2ZnryYtEniARQwfxXyvk0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028