UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yLlSvggMEPvYKUghqcluBh/oxXPH2BsKXPeBRHvwIo8=' 
WHERE 
  key_id = '1913d39f88e867be3e9bbd2d2434f5220b2d2f4537a22013994d0f7594384299' 
  AND (
    token = 'yLlSvggMEPvYKUghqcluBh/oxXPH2BsKXPeBRHvwIo8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034