UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1VJJY2O151Woa/9ShJ+nvou9O9vk/e1H4CeP7tdoBEo=' 
WHERE 
  key_id = '3d819a94c8400f581d33a2199496b0f2d9e33415e196213a746141e4cde439f7' 
  AND (
    token = '1VJJY2O151Woa/9ShJ+nvou9O9vk/e1H4CeP7tdoBEo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032