UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zki2SzZam1WnWz3IHO0J7Oh/Ty2Js3zu/Nx60jE2BlQ=' 
WHERE 
  key_id = '3da6e31f2138c9442c4aae52fe66d406c1cb94a1274968e26ddd5f2ceb582269' 
  AND (
    token = 'Zki2SzZam1WnWz3IHO0J7Oh/Ty2Js3zu/Nx60jE2BlQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035