UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Nxjp6z5eW+a3ksOhRtmnbJfOVm37UH+s7x7LCqeHM4=' 
WHERE 
  key_id = '611f09ca54580cedbee7427d7bfb7ffcf70f1f83d3b0d399e7b13de3b13d3323' 
  AND (
    token = '1Nxjp6z5eW+a3ksOhRtmnbJfOVm37UH+s7x7LCqeHM4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053