UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AOLGMxuv0ttn0NZkWPWxzuaxb/INGBe5zklQRL3TyI4=' 
WHERE 
  key_id = 'a0925fa06c11ca151db05ba6f23245c949899e5f40ebab5c89815ac81a55c2e1' 
  AND (
    token = 'AOLGMxuv0ttn0NZkWPWxzuaxb/INGBe5zklQRL3TyI4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021